//
//  HotCityCollectionViewCell.m
//  PTravel
//
//  Created by dllo on 15/11/18.
//  Copyright © 2015年 李涵. All rights reserved.
//

#import "HotCityCollectionViewCell.h"

@implementation HotCityCollectionViewCell

- (void)dealloc
{
    [_image release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}

- (void)createSubViews
{
    self.image = [[UIImageView alloc] initWithFrame:self.contentView.frame];
    self.image.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.image];
    [_image release];
}

- (void)setHotCity:(HotCity *)hotCity
{
    if (_hotCity != hotCity) {
        [_hotCity release];
        _hotCity = [hotCity retain];
    }
    NSURL *url = [NSURL URLWithString:hotCity.photo];
    [self.image sd_setImageWithURL:url placeholderImage:IMAGE];
}

@end
